#include <iostream>
using namespace std;

class Girl
{
public:
	Girl(string name = "girl") : m_string(name){}
	string getName()
	{
		return m_string;
	}

private:
	string m_string;
};

class Profession
{
public:
	virtual ~Profession(){}
	virtual void profess() = 0;
};

class YoungMan : public Profession
{
public:
	YoungMan(Girl girl) : m_girl(girl){}
	void profess()
	{
		cout << "Young man love " << m_girl.getName().data() << endl;
	}

private:
	Girl m_girl;
};

class ManProxy : public Profession
{
public:
	ManProxy(Girl girl) : m_man(new YoungMan(girl)){}
	void profess()
	{
		cout << "I am Proxy" << endl;
		m_man->profess();
	}

private:
	YoungMan* m_man;
};

int main()
{
	Girl girl("hei");
	Profession* proxy = new ManProxy(girl);
	proxy->profess();
	delete proxy;

	return 0;
}